package P2分治回溯;

public class RecursionDemo05 {
    public static void main(String[] args) {
        int num = fibo(100);
        System.out.println(num);
    }

    private static int fibo(int n) {
        if (n == 1 || n == 2) {
            return 1;
        }
        int[] dp = new int[n];
        dp[0] = 1;
        dp[1] = 1;
        for (int i = 2; i < dp.length; i++) {
            dp[i] = dp[i - 1] + dp[i - 2];
        }
        return dp[n - 1];
    }
}